package linc.cool.责任链模式;

import lombok.extern.slf4j.Slf4j;

import java.util.Objects;

/**
 * @author yqlin
 * @date 2021/12/29 12:13 AM
 * @description
 */
@Slf4j
public class ConcreteHandlerTwo extends Handler {
    @Override
    public void handleRequest(String request) {
        if (request.equals("two")) {
            log.debug("具体处理者2负责处理该请求!");
        } else {
            if (Objects.nonNull(this.getNext())) {
                this.getNext().handleRequest(request);
            } else {
                log.debug("没有人处理该请求!");
            }
        }
    }
}